$(document).ready(function() {
	$('div#list-container').showList(document.URL);
	$("a.add").showAddForm();
});


// Used to detect initial (useless) popstate.
// If history.state exists, assume browser isn't going to fire initial popstate.
var popped = ('state' in window.history && window.history.state !== null), initialURL = location.href;

// If Back Button Was Clicked
$(window).bind('popstate', function (event) {
	var initialPop = !popped && location.href == initialURL;
	popped = true
	$('div#list-container').showList(document.URL);
	if (initialPop) return;
});
